<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get the return value from a procedure call</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.ingres-fetch-proc-return" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ingres_fetch_proc_return</h1>
  <p class="verinfo">(PECL ingres &gt;= 1.4.0)</p><p class="refpurpose"><span class="refname">ingres_fetch_proc_return</span> &mdash; <span class="dc-title">Get the return value from a procedure call</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ingres-fetch-proc-return-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ingres_fetch_proc_return</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>
   ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   This function is used to retrieve the return value following the execution
   of an Ingres database procedure (stored procedure). 
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    If used with a row-producing procedure, this function should be called after all the
    rows from the procedure have been fetched using
    <span class="function"><a href="ingres_fetch_array.html" class="function">ingres_fetch_array()</a></span>,
    <span class="function"><a href="ingres_fetch_object.html" class="function">ingres_fetch_object()</a></span> or
    <span class="function"><a href="ingres_fetch_row.html" class="function">ingres_fetch_row()</a></span>. This function will eliminate any
    rows yet to be fetched should there be any left over.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ingres-fetch-proc-return-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">result</code></dt>

     <dd>

      <p class="para">
       The result identifier for a query
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ingres-fetch-proc-return-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> if there is a return value otherwise it will
   return <strong><code>NULL</code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ingres-fetch-proc-return-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1307">
    <p><strong>Example #1 Get the return value from a procedure call</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$link&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ingres_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$database</span><span style="color: #007700">);<br /><br />if&nbsp;(&nbsp;</span><span style="color: #0000BB">ingres_errno</span><span style="color: #007700">()&nbsp;!=&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$error_text&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ingres_error</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #0000BB">$error_text</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ingres_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"execute&nbsp;procedure&nbsp;php_proc&nbsp;(value&nbsp;=&nbsp;1000)"</span><span style="color: #007700">);<br /><br />if&nbsp;(&nbsp;</span><span style="color: #0000BB">ingres_errno</span><span style="color: #007700">()&nbsp;!=&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$error_text&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ingres_error</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #0000BB">$error_text</span><span style="color: #007700">);<br />}<br /><br />echo&nbsp;</span><span style="color: #DD0000">"return&nbsp;value&nbsp;-&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ingres_fetch_proc_return</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">ingres_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.ingres-fetch-proc-return-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="ingres_query.html" class="function" rel="rdfs-seeAlso">ingres_query()</a> - Send an SQL query to Ingres</span></li>
    <li class="member"><span class="function"><a href="ingres_fetch_array.html" class="function" rel="rdfs-seeAlso">ingres_fetch_array()</a> - Fetch a row of result into an array</span></li>
    <li class="member"><span class="function"><a href="ingres_fetch_object.html" class="function" rel="rdfs-seeAlso">ingres_fetch_object()</a> - Fetch a row of result into an object</span></li>
    <li class="member"><span class="function"><a href="ingres_fetch_row.html" class="function" rel="rdfs-seeAlso">ingres_fetch_row()</a> - Fetch a row of result into an enumerated array</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>